home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1995 / MacHack 1995.toast / Presentations / Presentations ’91 / DAL Files / DALtool 6⁄6 (System 7.x) / DalDemo.c < prev    next >
C/C++ Source or Header  |  1991-06-02  |  1KB  |  57 lines

  1.  
  2. #include "DalDemo.h"
  3.  
  4. /* Global vars */
  5. Boolean gDone, gWNEImplemented;
  6. EventRecord    gTheEvent;
  7. MenuHandle    gAppleMenu, gFileMenu, gEditMenu;
  8. CharsHandle    gInText;
  9. Rect    gDragRect;
  10. Rect    gInRect = {22, 43, 160, 400},
  11.         gInScrollBarRect = {22,404,160,420},
  12.         gOutRect = {165, 43, 340, 400},
  13.         gOutScrollBarRect = {165,404, 340, 420};
  14. int        gNewWindowLeft = WINDOW_HOME_LEFT, gNewWindowTop = WINDOW_HOME_TOP;
  15. int        gLinesInFolder;
  16. Str255    gNodename, gUsername, gPassword;
  17. char     dirty;
  18.  
  19. /*** main ***/
  20. main()
  21. {
  22.     ToolBoxInit();
  23.     MenuBarInit();
  24.     SetUpDragRect();
  25.     MaxApplZone();
  26.     GlobalVarInit();
  27.     
  28.     MainLoop();
  29. }
  30.  
  31.  
  32. /*** MainLoop ***/
  33. MainLoop()
  34. {
  35.     RgnHandle cursorRgn;
  36.     Boolean    gotOne;
  37.     
  38.     cursorRgn = NewRgn();
  39.     
  40.     while (!gDone)
  41.     {
  42.         if (gWNEImplemented)
  43.             gotOne = WaitNextEvent(everyEvent, &gTheEvent, MIN_SLEEP, cursorRgn);
  44.         else
  45.         {
  46.             SystemTask();
  47.             gotOne = GetNextEvent(everyEvent, &gTheEvent);
  48.         }
  49.         AdjustCursor(gTheEvent.where, cursorRgn);
  50.         if (gotOne)
  51.             HandleEvent();
  52.         else
  53.             HandleIdle();
  54.     }
  55. }
  56.  
  57.